<!DOCTYPE html>
<html>
<head>
<title>管理员列表</title>
<#include "/header.html">
</head>
<style>
	.tabs{
		font-size: 14px;
		color: #657180;
		margin-top: 10px;
	}
	.tabs-bar:after{
		content: '';
		display: block;
		width: 100%;
		height: 1px;
		background: #d7dde4;
		margin-top:-1px;
	}
	.tabs-tab{
		display: inline-block;
		padding: 4px 16px;
		margin-right: 6px;
		background: #fff;
		border: 1px solid #d7dde4;
		cursor: pointer;
		position: relative;
	}
	.tabs-tab-active{
		color: #3399ff;
		border-top: 1px solid #3399ff;
		border-bottom: 1px solid #3399ff;
	}
	.tabs-tab-active:before{
		content: '';
		display: block;
		height: 1px;
		background: #3399ff;
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
	}
	.tabs-content{
		padding: 8px 0;
	}
	.el-upload__input {
		display: none !important;
	}
</style>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">
			<div style="float: left;height:34px;line-height:34px;">用户名：</div>
			<div style="float: left;margin-right: 10px;">
				<input type="text" class="form-control" v-model="q.username" @keyup.enter="query" placeholder="用户名">
			</div>
			<a class="btn btn-default" @click="query">查询</a>
			<#if shiro.hasPermission("sys:user:save")>
			<a class="btn btn-primary" @click="add">&nbsp;新增</a>
			</#if>
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>

	<div v-show="!showList" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
		<tabs v-model='value'>
			<pane label="基本信息" name='1'>
				<form class="form-horizontal">
					<div class="form-group">
						<div class="col-sm-2 control-label"><span style="color: red">*</span>用户名</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="user.userEntity.username" placeholder="登录账号"/>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label"><span style="color: red">*</span>密码</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="user.userEntity.password" placeholder="密码"/>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label"><span style="color: red">*</span>确认密码</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="user.userEntity.password" placeholder="确认密码"/>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label"><span style="color: red">*</span>邮箱</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="user.userEntity.email" placeholder="邮箱"/>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label"><span style="color: red">*</span>手机号</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="user.userEntity.mobile" placeholder="手机号"/>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label"><span style="color: red">*</span>佣金</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="user.userEntity.commission" placeholder="佣金比例"/>
							<span style="position: absolute;right: 22px;top: 8px;color: #4C4948;line-height: 1.5;">%</span>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label">状态</div>
						<label class="radio-inline">
							<input type="radio" name="status" value="0" v-model="user.userEntity.status"/> 禁用
						</label>
						<label class="radio-inline">
							<input type="radio" name="status" value="1" v-model="user.userEntity.status"/> 正常
						</label>
					</div>
				</form>
			</pane>
			<pane label="渠道信息" name='2'>
				<form class="form-horizontal">
					<div class="form-group">
						<div class="col-sm-2 control-label"><span style="color: red">*</span>名称</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="user.authenticationEntity.name" placeholder="商家名称"/>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label"><span style="color: red">*</span>营业执照</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="user.authenticationEntity.businesslicense" placeholder="营业执照号"/>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label">营业执照图片</div>
						<div class="col-sm-10">
							<el-upload
									class="upload-demo"
									action="http://localhost:8081/renren-api/api/file/uploadfile"
									:on-preview="handlePreview1"
									:on-remove="handleRemove1"
									:file-list="fileList1"
									:on-success="handsuccess1"
									list-type="picture">
								<el-button size="small" type="primary">点击上传</el-button>
							</el-upload>

							<input type="text" class="form-control" v-model="user.authenticationEntity.businesslicenseimg" style="display: none;"/>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label"><span style="color: red">*</span>法人姓名</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="user.authenticationEntity.legalname" placeholder="法人姓名"/>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label"><span style="color: red">*</span>法人身份证</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="user.authenticationEntity.legalid" placeholder="法人身份证"/>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label">法人身份证图片</div>
						<div class="col-sm-10">
							<el-upload
									class="upload-demo"
									action="http://localhost:8081/renren-api/api/file/uploadfile"
									:on-preview="handlePreview2"
									:on-remove="handleRemove2"
									:file-list="fileList2"
									:on-success="handsuccess2"
									list-type="picture">
								<el-button size="small" type="primary">点击上传</el-button>
							</el-upload>

							<input type="text" class="form-control" v-model="user.authenticationEntity.legalidimg" style="display: none;"/>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label"><span style="color: red">*</span>电话</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="user.authenticationEntity.telphone" placeholder="电话"/>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label"><span style="color: red">*</span>支付宝账户</div>
						<div class="col-sm-10">
							<input type="text" class="form-control" v-model="user.authenticationEntity.alipayaccount" placeholder="支付宝账户"/>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-2 control-label"></div>
						<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
						&nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
					</div>
				</form>
			</pane>
		</tabs>

	</div>
</div>

<!-- 选择部门 -->
<div id="deptLayer" style="display: none;padding:10px;">
	<ul id="deptTree" class="ztree"></ul>
</div>

<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>

<script src="${request.contextPath}/statics/js/modules/sys/franchisee.js?_${.now?long}"></script>
<script src="${request.contextPath}/statics/js/pane.js"></script>
<script src="${request.contextPath}/statics/js/tab.js"></script>
</body>
</html>